package 包装类编程题;

import java.util.Scanner;

public class Student {
    private String name;
    private Integer age;
    private Double height;
    private boolean marriage;
    private Character gender;

    public Student(String name, Integer age, Double height, boolean marriage, Character gender) {
        this.name = name;
        this.age = age;
        this.height = height;
        this.marriage = marriage;
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", height=" + height +
                ", marriage=" + marriage +
                ", gender=" + gender +
                '}';
    }
}

class TestStudent{
    public static void main(String[] args) {
        String name,age,height,marriage,gender;
        Scanner in = new Scanner(System.in);
        System.out.println("Enter name");
        name = in.nextLine();
        System.out.println("Enter age");
        age = in.nextLine();
        System.out.println("Enter height");
        height = in.nextLine();
        System.out.println("Enter marriage");
        marriage = in.nextLine();
        System.out.println("Enter gender");
        gender = in.nextLine();
        Student s = new Student(name,Integer.parseInt(age),Double.parseDouble(height),Boolean.parseBoolean(marriage),
                gender.charAt(0));
        System.out.println(s);

    }
}
